from django.db import models


class NewsItem(models.Model):
    news_item_id = models.AutoField(primary_key=True, verbose_name="新闻ID")
    news_item_title = models.CharField(max_length=500, verbose_name="新闻标题")
    create_time = models.DateTimeField(null=True, blank=True, auto_now_add=True, verbose_name="创建时间")
    update_time = models.DateTimeField(null=True, blank=True, auto_now=True, verbose_name="更新时间")
    news_item_content = models.TextField(null=True, blank=True, verbose_name="新闻正文")
    status = models.PositiveIntegerField(default=1, verbose_name="新闻状态")
    image_list = models.CharField(
        max_length=2048, null=True, blank=True, verbose_name="图片列表"
    )
    news_item_editor = models.CharField(
        max_length=100, null=True, blank=True, verbose_name="新闻作者"
    )
    video_list = models.CharField(
        max_length=2048, null=True, blank=True, verbose_name="视频列表"
    )
    audio_list = models.CharField(
        max_length=2048, null=True, blank=True, verbose_name="音频列表"
    )
    news_item_cate = models.CharField(
        max_length=100, null=True, blank=True, verbose_name="新闻分类"
    )
    news_item_link = models.CharField(
        max_length=2048, null=True, blank=True, verbose_name="新闻链接"
    )
    news_item_src = models.CharField(
        max_length=100, null=True, blank=True, verbose_name="新闻来源"
    )
    news_item_reldate = models.DateTimeField(
        auto_now=False, null=True, blank=True, verbose_name="新闻发布时间"
    )
    news_item_subtitle = models.CharField(
        max_length=500, null=True, blank=True, verbose_name="新闻副标题"
    )
    news_item_content_div = models.TextField(
        null=True, blank=True, verbose_name="新闻正文带标签"
    )
    news_item_origin_id = models.IntegerField(
        null=True, blank=True, verbose_name="新闻原始ID"
    )

    class Meta:
        db_table = "news_items"
        verbose_name = "新闻条目"
        verbose_name_plural = "新闻条目"

    def __str__(self):
        return self.news_item_title
